<?php
$postdata =
array( 'login'      => 'admin',
       'password'   => '123',
       'action'     => 'phones_report',
       'details'    => '1'


);
$jsondata = json_encode($postdata);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost/AMIautocall/action.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "action=".$jsondata);
$out=curl_exec($ch);
curl_close($ch);
print_r($out);   ?>